package com.java2_29;

//继承方式
public class MyThreadJi extends Thread {
    public static int number = 100;

    public MyThreadJi() {
    }

    public MyThreadJi(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 30; i++) {
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
            System.out.println(Thread.currentThread().getName() + "  这是继承方式创建的多线程" + "  获取了" + i + "点number");
            number--;
//            if(i == 20){
//
//            }
        }
    }

    public static int getNumber() {
        return number;
    }

    public static void setNumber(int number) {
        MyThreadJi.number = number;
    }
}
